#!/usr/bin/python
#coding=utf-8

import rospy
from rosmsg.msg import route

def ros_init(name):
	rospy.init_node('python', anonymous=True)
	pub = rospy.Publisher(name, route, queue_size=1)

	return pub

def send_route(pub, lon, lat):
	msg = route()

	msg.success = True
	msg.lon = lon
	msg.lat = lat

	pub.publish(msg)


if __name__ == '__main__':
	lon = [103.924679870, 103.924784958, 103.924928865, 103.924679870]
	lat = [30.749236845, 30.749306654, 30.749229391, 30.749236845]

	pub = ros_init('/route')

	while not rospy.is_shutdown():
		send_route(pub, lon, lat)
		rospy.Rate(1).sleep()
		send_route(pub, lon, lat)
		rospy.Rate(1).sleep()
		rospy.signal_shutdown('done!')
